package com.hdax.mappers;

import com.hdax.entity.Attendance;
import com.hdax.entity.Leave;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
@Mapper
public interface LeaveMapper {


    /**
     * 模糊查询
     * @param offset
     * @param limit
     * @param leave
     * @return
     */
    List<Leave> findAll(@Param("offset")int offset, @Param("limit")int limit, @Param("leave")Leave leave);

    /**
     * 添加
     * @param leave
     * @return
     */
    int insertByid(@Param("leav") Leave leave);

    /**
     * 修改
     * @param leave
     * @return
     */
    int updateByid(@Param("lea") Leave leave);

    /**
     * 根据部门,查询该部门下的请假人数
     * @param departmentid
     * @return
     */
    List<Leave> findByRoleid(@Param("did") int departmentid);

    /**
     * 根据编号查询内容
     * @param id
     * @return
     */
    Leave findBylid(@Param("id") int id);
}
